Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle GDAL-land exceptions raised after upgrading pygeoprocessing #1646

Merged

Conversation

phargogh
Copy link
Member

@phargogh phargogh commented Oct 11, 2024

This just adds support for GDAL's RuntimeErrors in addition to pygeoprocessing's ValueErrors . I left both in, in case we have a case where we are supporting earlier versions of pygeoprocessing since it was trivial to support both versions of the exception.

I also addressed an exception occurring in one of the tests because of a file name we changed recently.

Fixes #1645

Checklist

  • Updated HISTORY.rst and link to any relevant issue (if these changes are user-facing)
    - [ ] Updated the user's guide (if needed)
    - [ ] Tested the Workbench UI (if relevant)

@phargogh phargogh self-assigned this Oct 11, 2024
@phargogh phargogh changed the title Handle GDAL-land exceptions in validation when getting raster info Handle GDAL-land exceptions Oct 11, 2024
@phargogh phargogh changed the title Handle GDAL-land exceptions Handle GDAL-land exceptions raised after upgrading pygeoprocessing Oct 11, 2024
@phargogh phargogh marked this pull request as ready for review October 15, 2024 19:48
@davemfish davemfish self-requested a review October 15, 2024 19:50
@@ -121,6 +121,25 @@ def capture_gdal_logging():
gdal.PopErrorHandler()


@contextlib.contextmanager
def _set_gdal_configuration(opt, value):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks handy

@davemfish davemfish merged commit cda9da8 into natcap:main Oct 15, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using gdal.UseExceptions raising exceptions in tests
2 participants